﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TopMenuManager.aspx.cs" Inherits="YhmOA.ManagerOA.Menu.TopMenuManager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <link type="text/css" rel="Stylesheet" href="../../Styles/Common.css" />
    <script type="text/javascript" src="../../Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src="../../Scripts/Common.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="min-height:500px">
        <asp:TextBox ID="txt_ChildMenuName" runat="server" style="display:none"></asp:TextBox>
        <asp:TextBox ID="txt_ChildMenuID" runat="server" style="display:none"></asp:TextBox>
    <table class="Table" style="width:100%;">
        <tr>
            <td>
                <input class="Button" onclick="DialogInfo('/Commons/SelectItem.aspx?data=TopMenuSelectLeftTop&topID=<%=TopID %>','选择子菜单',370,200,20);" style="width: 100px" type="text" value="选择子菜单" />
            </td>
        </tr>
    </table>
    <asp:GridView ID="gvShow" runat="server" Width="100%" EmptyDataText="暂无数据..." 
        CssClass="Table" onrowcommand="gvShow_RowCommand" 
            onrowdatabound="gvShow_RowDataBound">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>菜单名称</HeaderTemplate>
                <ItemTemplate><%#Eval("Name") %></ItemTemplate>
                <ItemStyle Width="120px" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>操作</HeaderTemplate>
                <ItemTemplate>
                    <asp:ImageButton ID="ImgBtnUp" CommandName="ImgBtnUp" runat="server" ImageUrl="~/Images/up.png"/>
                    <asp:ImageButton ID="ImgBtnDown" CommandName="ImgBtnDown" runat="server" ImageUrl="~/Images/down.png"/>
                    <asp:ImageButton ID="ImgBtnDel" CommandName="ImgBtnDel" runat="server" ImageUrl="~/Images/delete.png"/>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <HeaderStyle CssClass="ThCenter" />
        <RowStyle CssClass="TdCenter" />
    </asp:GridView>
    </div>
    <script type="text/javascript">
        function CallFun(rs) {
            var aa = rs.split(",");
            var txt_ChildMenuID = "-1";
            var txt_ChildMenuName = "-1";
            for (var i = 0; i < aa.length; i++) {
                txt_ChildMenuID = txt_ChildMenuID + "," + aa[i].split("#")[0];
                txt_ChildMenuName = txt_ChildMenuName + "," + aa[i].split("#")[1];
            }
            txt_ChildMenuID = txt_ChildMenuID.replace("-1,", "");
            txt_ChildMenuName = txt_ChildMenuName.replace("-1,", "");
            var txt_ChildMenuIDobj = document.getElementById("txt_ChildMenuID");
            var txt_ChildMenuNameobj = document.getElementById("txt_ChildMenuName");
            txt_ChildMenuIDobj.value = (txt_ChildMenuIDobj.value == "" ? "" : txt_ChildMenuIDobj.value + ",") + txt_ChildMenuID;
            txt_ChildMenuNameobj.value = (txt_ChildMenuNameobj.value == "" ? "" : txt_ChildMenuNameobj.value + ",") + txt_ChildMenuName;
            BindDataGridView();
        }
    </script>
    </form>
</body>
</html>
